package com.ssm.common;


import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {
    /**
     * 全局的异常处理;
     * @param ex ;
     * @return ;
     */
    @ExceptionHandler({Exception.class})
    public Result MyException(Exception ex){
        ex.printStackTrace();
        return Result.fail(500,"出现异常",ex.getMessage());
    }
}
